<template>
	<view class="applyspace">
		<Hearder :name="'申请空间主'"></Hearder>
		<view class="content bgbottom">
			<view class="list">
				<view class="lable">空间名:</view>
				<view class="right">
					<input placeholder="请输入空间名" placeholder-style="color:#999;" v-model="name">
				</view>
			</view>
			<view class="list">
				<view class="lable">申请原因:</view>
				<view class="right">
					<textarea placeholder="请输入申请原因" placeholder-style="color:#999;" v-model="reason"></textarea>
				</view>
			</view>
		</view>
		<view class="surebtn" @click="surexiugai">申请</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				name:'',
				reason:''
			}
		},
		methods:{
			surexiugai(){
				this.request('/member/toApplySpace',{name:this.name,reason:this.reason}).then(res => {
					if(res.data.code==1){
						this.$tip(res.data.msg)
						setTimeout(()=>{
							uni.navigateBack()
						},500)
					}else{
						this.$tip(res.data.msg)
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.applyspace{
		.content{
			padding: 0 4%;
			.list{
				display: flex;
				justify-content: space-between;
				align-items: flex-start;
				padding: 40rpx 0;
				border-bottom: $uni-border-bottom;
				&:last-of-type{
					border: none;
				}
				.lable{
					width: 25%;
				}
				.right{
					width: 75%;
					input,
					textarea{
						width: 100%;
						font-size: 30rpx;
					}
				}
			}
		}
		.surebtn{
			background: $uni-item-color;
			text-align: center;
			line-height: 88rpx;
			height: 88rpx;
			color: #fff;
			margin: 40rpx 4%;
			font-size: 32rpx;
		}
	}
</style>